﻿using System.Collections.Generic;

namespace Kiva7.ViewModels
{
    public class LoanTotals
    {
        public string Key { get; set;  }
        public double Value { get; set; }
    }

    public class LoanTotalsCollection : Dictionary<string, LoanTotals>
    {
        public void Add(string key, double value)
        {
            LoanTotals totals;
            if (this.ContainsKey(key))
            {
                totals = this[key];
            }
            else
            {
                totals = new LoanTotals();
                totals.Key = key;
                this.Add(key, totals);
            }
            totals.Value += value;
        }
    }
}
